<template>
  <a-config-provider :locale="locale">
    <a-spin :spinning="userStore.globalLoading" style="max-height:100vh;">
      <div id="app">
        <router-view />
      </div>
    </a-spin>
  </a-config-provider>
</template>

<script setup lang="ts">
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { useUserStore } from '@/store/modules/user'
import storage from 'store'


function getParamsFromUrl() {
  const queryString = window.location.search;
  const urlParams = new URLSearchParams(queryString);
  const iToken = urlParams.get('iToken');
  if(iToken){
    storage.set('iToken',iToken)
  }
  
}

getParamsFromUrl();


import { toggleTheme } from '@zougt/vite-plugin-theme-preprocessor/dist/browser-utils.js' // 换色插件
import { useOem } from '@/store/modules/oem'
const userStore = useUserStore() 

let locale = zhCN
dayjs.locale('zh-cn')

// 切换主题色
toggleTheme({ scopeName: useOem().getSiteInfo().agent.sysPrimaryColor })

</script>
